home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1995 October
/
EnigmA AMIGA RUN 01 (1995)(G.R. Edizioni)(IT)[!][issue 1995-10][Aminet 7].iso
/
Aminet
/
gfx
/
show
/
svoUtah22.lha
/
svoUtahRLE
/
source
/
SV_AsmPart.a
< prev
next >
Wrap
Text File
|
1995-04-14
|
10KB
|
380 lines
; * ************************************************************************ *
; * 'UtahRLE.svobject' V2.2 *
; * ************************************************************************ *
; * (c) 1995 by Andreas Ralph Kleinert. All rights reserved. *
; * This code can be used to create the 'UtahRLE.svobject'. *
; * THIS IS NOT ALLOWED WITHOUT SPECIAL PERMISSION BY THE AUTHOR !!! *
; * ************************************************************************ *
; * Address : Andreas R. Kleinert *
; * Grube Hohe Grethe 23 *
; * D-57074 Siegen *
; * Germany *
; * ************************************************************************ *
; * ************************************************************************ *
; * Module : SV_AsmPart.a *
; * Version : V2.2 *
; * Last updated : 14.4.1995 *
; * Includes : V40-Includes *
; * Compiler : SAS/C V6.55 (ASM) *
; * Compiler-Options : (smakefile) *
; * ************************************************************************ *
INCLUDE "exec/types.i"
INCLUDE "exec/execbase.i"
INCLUDE "exec/initializers.i"
INCLUDE "exec/libraries.i"
INCLUDE "exec/resident.i"
VERSION EQU 2
REVISION EQU 2
XREF _LinkerDB
XREF _LVOOpenLibrary
XREF _LVOCloseLibrary
XREF _LVORemove
XREF _LVOFreeMem
XREF _SVLI_InitSVOList ; library-internal initialization function
XREF _SVO_AllocHandle
XREF _SVO_FreeHandle
XREF _SVO_Show
XREF _SVO_Write
XREF _SVO_CloseDisplay
XREF _SVO_FreeResources
XREF _SVO_SetAccessMode
XREF _SVO_SetWriteSubType
XREF _SVO_SetScreenType
XREF _SVO_SetWindowFlags
XREF _SVO_SetWindowIDCMP
XREF _SVO_GetScreenAddress
XREF _SVO_GetWindowAddress
XREF _SVO_SetScreenAddress
XREF _SVO_SetWindowAddress
XREF _SVO_SetWriteName
XREF _SVO_SetReadName
XREF _SVO_FileInfoRequest
XREF _SVO_CheckFileType
XREF _SVO_ReadToGfxBuffer ; added in V2
XREF _SVO_GetGfxBuffer
XREF _SVO_SetGfxBuffer
STRUCTURE SVObjectBase,0
STRUCT svb_LibNode,LIB_SIZE
ULONG svb_SVObject
ULONG svb_Reserved,32
ULONG svb_SegList
ULONG svb_SysBase
ULONG svb_DOSBase
ULONG svb_IntuitionBase
ULONG svb_GfxBase
ULONG svb_UtilityBase
ULONG svb_MathIeeeDoubBasBase
ULONG svb_MathIeeeDoubTransBase
ULONG svb_SVSupportBase
LABEL svb_SIZEOF
SECTION svb_lib,CODE
;-------------- `Notausgang` ------------------------------------------------
Start: moveq #0,d0
rts
;-------------- Resident-Struktur -------------------------------------------
ROMTag:
dc.w RTC_MATCHWORD
dc.l ROMTag ; ptr to itself
dc.l EndResident ; ptr to end of Resident-Structure
dc.b RTF_AUTOINIT ; Initialisierungsart
dc.b VERSION ; Version
dc.b NT_LIBRARY ; Node-Typ
dc.b REVISION ; Prioritaet
dc.l SVLibName ; Name
dc.l SVLibID ; LibIDString
dc.l InitTab ; ptr to InitTab
SVLibName: dc.b 'UtahRLE.svobject',0
SVLibID: dc.b 'UtahRLE 2.2 (14.4.95)',13,10,0
AKCopyright: dc.b '(c) 1995 by Andreas R. Kleinert',0
DosName: dc.b 'dos.library',0
IntuitionName: dc.b 'intuition.library',0
GfxName: dc.b 'graphics.library',0
UtilityName: dc.b 'utility.library',0
MathIeeeDoubBasName: dc.b 'mathieeedoubbas.library',0
MathIeeeDoubTransName: dc.b 'mathieeedoubtrans.library',0
SVSupportName: dc.b 'superviewsupport.library',0
ds.w 0
EndResident:
;-------------- Funktionstabellen fuer InitStruct u.a. ----------------------
InitTab:
dc.l svb_SIZEOF ; LibBase-Size
dc.l FuncTab ; Function-Table begin
dc.l DataTab ; Data-Table begin
dc.l InitLib ; ptr to InitLib
FuncTab:
dc.l OpenLib ; internal functions
dc.l CloseLib
dc.l ExpungeLib
dc.l ExtFuncLib
dc.l _SVO_AllocHandle
dc.l _SVO_FreeHandle
dc.l _SVO_Show
dc.l _SVO_Write
dc.l _SVO_CloseDisplay
dc.l _SVO_FreeResources
dc.l _SVO_SetAccessMode
dc.l _SVO_SetWriteSubType
dc.l _SVO_SetScreenType
dc.l _SVO_SetWindowFlags
dc.l _SVO_SetWindowIDCMP
dc.l _SVO_GetScreenAddress
dc.l _SVO_GetWindowAddress
dc.l _SVO_SetScreenAddress
dc.l _SVO_SetWindowAddress
dc.l _SVO_SetWriteName
dc.l _SVO_SetReadName
dc.l _SVO_FileInfoRequest
dc.l _SVO_CheckFileType
dc.l _SVO_ReadToGfxBuffer ; added in V2
dc.l _SVO_GetGfxBuffer
dc.l _SVO_SetGfxBuffer
dc.l -1
DataTab:
INITBYTE LN_TYPE,NT_LIBRARY
INITLONG LN_NAME,SVLibName
INITBYTE LIB_FLAGS,LIBF_SUMUSED!LIBF_CHANGED
INITWORD LIB_VERSION,VERSION
INITWORD LIB_REVISION,REVISION
INITLONG LIB_IDSTRING,SVLibID
dc.l 0
;-------------- InitLib (Initialisieren der Library) ---------------------------
; A0 : &SegList
; A6 : &SysBase
; D0 : &SVLibrary
InitLib:
movem.l a1/a4-a5,-(sp) ; a4 und a5 auf Stack retten
lea _LinkerDB,a4 ; _LinkerDB -> A4
move.l d0,a5 ; &SVLibrary -> A5
move.l a6,_SysBase(a4) ; &SysBase retten
move.l a6,svb_SysBase(a5) ; &SysBase -> SVLibrary.svb_SysBase
move.l a0,svb_SegList(a5) ; &SegList -> SVLibrary.svb_SegList
lea DosName,a1
move.l #37,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_DOSBase
move.l d0,svb_DOSBase(a5) ; save it !
lea IntuitionName,a1
move.l #37,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_IntuitionBase
move.l d0,svb_IntuitionBase(a5) ; save it !
lea GfxName,a1
move.l #37,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_GfxBase
move.l d0,svb_GfxBase(a5) ; save it !
lea UtilityName,a1
move.l #37,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_UtilityBase
move.l d0,svb_UtilityBase(a5) ; save it !
lea MathIeeeDoubBasName,a1
move.l #33,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_MathIeeeDoubBasBase
move.l d0,svb_MathIeeeDoubBasBase(a5) ; save it !
lea MathIeeeDoubTransName,a1
move.l #33,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_MathIeeeDoubTransBase
move.l d0,svb_MathIeeeDoubTransBase(a5) ; save it !
lea SVSupportName,a1
move.l #3,d0
LINKLIB _LVOOpenLibrary,_SysBase
move.l d0,_SVSupportBase
move.l d0,svb_SVSupportBase(a5) ; save it !
tst.l _DOSBase
beq InitLib_Fail
tst.l _IntuitionBase
beq InitLib_Fail
tst.l _GfxBase
beq InitLib_Fail
tst.l _UtilityBase
beq InitLib_Fail
tst.l _MathIeeeDoubBasBase
beq InitLib_Fail
tst.l _MathIeeeDoubTransBase
beq InitLib_Fail
tst.l _SVSupportBase
beq InitLib_Fail
move.l a5,_SVObjectBase ; save Base Address for internal use
jsr _SVLI_InitSVOList
move.l a5,d0 ; return &SVObjectBase
jmp InitLib_RTS
InitLib_Fail:
moveq #0,d0 ; NULL !
InitLib_RTS:
movem.l (sp)+,a1/a4-a5
rts
;-------------- OpenLib (Oeffnen der Library) ----------------------------------
OpenLib:
addq.w #1,LIB_OPENCNT(a6) ; LIB_OPENCNT ++
bclr #LIBB_DELEXP,LIB_FLAGS(a6) ; clear LIBF_DELEXP
move.l a6,d0 ; return &SVObjectBase
rts
;-------------- CloseLib (Schliessen der Library) ------------------------------
CloseLib:
moveq #0,d0
subq.w #1,LIB_OPENCNT(a6) ; LIB_OPENCNT --
bne.s EndCloseLib ; wenn nicht null, Abbruch
btst #LIBB_DELEXP,LIB_FLAGS(a6) ; Test auf LIBF_DELEXP
beq.s EndCloseLib ; wenn Null, Abbruch
bsr.s ExpungeLib ; wenn gesetzt, ExpungeLib
EndCloseLib:
rts
;-------------- ExpungeLib (Entfernen der Library) ----------------------------
ExpungeLib:
movem.l d2/a1/a5-a6,-(sp)
move.l a6,a5 ; &SVLibrary retten
move.l _SysBase,a6 ; ExecBase to A6
tst.w LIB_OPENCNT(a5) ; test LIB_OPENCNT
beq.s NoOpenLib ; ...
bset #LIBB_DELEXP,LIB_FLAGS(a5) ; set LIBF_DELEXP flag
moveq #0,d0 ; Ptr auf Segmentliste
bra.w ExpungeLibEnd ;
NoOpenLib:
move.l svb_SegList(a5),d2 ; SegList retten
move.l a5,a1 ; &SVLibrary nach A1 (Par.)
LINKLIB _LVORemove,_SysBase ; Library-Node entfernen
move.l _DOSBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
move.l _IntuitionBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
move.l _GfxBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
move.l _UtilityBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
move.l _MathIeeeDoubBasBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
move.l _MathIeeeDoubTransBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
move.l _SVSupportBase,a1
LINKLIB _LVOCloseLibrary,_SysBase
moveq #0,d0 ; D0 loeschen
move.l a5,a1 ; &SVLibrary nach A1 (Par.)
move.w LIB_NEGSIZE(a5),d0 ; Groesse der
sub.l d0,a1 ; Library
add.w LIB_POSSIZE(a5),d0 ; ermitteln !!!
LINKLIB _LVOFreeMem,_SysBase ; Speicher freigeben
move.l d2,d0 ; &SegList zurueckgeben
ExpungeLibEnd:
movem.l (sp)+,d2/a1/a5-a6
rts
;-------------- ExtFuncLib (bis einschl. OS V2.04 unbenutzt) ---------------
ExtFuncLib:
moveq #0,d0 ; Ist nie falsch ........ - oder ?
rts
;-------------- Eigene Funktionen ------------------------------------------
SECTION __MERGED,BSS
_SVObjectBase: ds.l 1
_SysBase: ds.l 1
_DOSBase: ds.l 1
_IntuitionBase: ds.l 1
_GfxBase: ds.l 1
_UtilityBase: ds.l 1
_MathIeeeDoubBasBase: ds.l 1
_MathIeeeDoubTransBase: ds.l 1
_SVSupportBase: ds.l 1
_XCEXIT: ds.l 1 ; dummy-values to get the compiler's libs work :
__XCEXIT: ds.l 1
_ONBREAK: ds.l 1
__ONBREAK: ds.l 1
__base: ds.l 1
___base: ds.l 1
_ProgramName: ds.l 1
__ProgramName: ds.l 1
_StackPtr: ds.l 1
__StackPtr: ds.l 1
_oserr: ds.l 1
__oserr: ds.l 1
_OSERR: ds.l 1
__OSERR: ds.l 1
XDEF _SVObjectBase
XDEF _SysBase
XDEF _DOSBase
XDEF _IntuitionBase
XDEF _GfxBase
XDEF _UtilityBase
XDEF _MathIeeeDoubBasBase
XDEF _MathIeeeDoubTransBase
XDEF _SVSupportBase
XDEF _XCEXIT
XDEF __XCEXIT
XDEF _ONBREAK
XDEF __ONBREAK
XDEF __base
XDEF ___base
XDEF _ProgramName
XDEF __ProgramName
XDEF _StackPtr
XDEF __StackPtr
XDEF _oserr
XDEF __oserr
XDEF _OSERR
XDEF __OSERR
END